package com.zmx.doctor.adapter;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.wang.adapters.adapter.BaseAdapterRvList;
import com.wang.adapters.base.BaseViewHolder;
import com.zmx.doctor.R;
import com.zmx.doctor.pojo.SearchArticle;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 程序猿：胖胖祥
 * 时 间：2020/11/24  18:51
 * 功 能：
 */
public class SearchArticleAdapter extends BaseAdapterRvList<SearchArticleAdapter.ViewHolder, SearchArticle> {

    public SearchArticleAdapter(Activity activity) {
        super(activity);
    }

    @Override
    protected void onBindVH(ViewHolder holder, int listPosition, SearchArticle searchArticle) {

        holder.title.setText(searchArticle.getTitle());
    }

    @NonNull
    @Override
    protected ViewHolder onCreateVH(ViewGroup parent, LayoutInflater inflater) {
        SearchArticleAdapter.ViewHolder holder = new SearchArticleAdapter.ViewHolder(inflater.inflate(R.layout.adapter_search_article, parent, false));
        return holder;
    }

    static class ViewHolder extends BaseViewHolder {

        @BindView(R.id.title)
        TextView title;

        ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }

    }

}
